/**
 * name:登录服务
 * describe:请输入描述
 */
import {Injectable}    from '@angular/core';
import { ApiService } from './api.service';
 
@Injectable()
export class LoginService {
 
  constructor(private apiService: ApiService) {
  }
 
  /**
   * 登陆功能
   * @param params
   * @returns {Promise<{}>}
   */
  login(username: string, password: string) {
    return this.apiService.post({
      method: 'POST',
      url: 'http://localhost:8080/services/login', // 登录URL
      data: {
        username: username,
        password: password
      },
    });
  }
 
  /**
   * 注册
   * @param user
   * @returns {any}
   */
  reguster(user: any) {
    return this.apiService.post({
      method: 'POST',
      url: 'http://119.232.19.182:8090/reguster',
      data: {
        user: user
      },
    });
 
  }
}